<?php
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'JCjqGridConfig.php');
class JCjqGridRowEditingEvents extends JCjqGridConfig {  
    const JC_URL = 'index.php/jsonApi/json';
    const JC_EDITURL = 'index.php/jsonApi/edit';
    const JC_FLAG = 'edit';
    
    private $colNames = true;
    private $dataApi = true;
    private $pageLimit = true;

    public function run()
   {
        
        $this->render('JCjqGridRowEditingEvents',
                $this->includeCode(
                        array(
                            "url"=>  JCjqGridRowEditingEvents::JC_URL.'?action='.$this->getDataApi(),
                            "editUrl"=>  JCjqGridRowEditingEvents::JC_EDITURL,
                            "flag"=>  JCjqGridRowEditingEvents::JC_FLAG,
                            'colNames'=>  $this->getColNames(),
                            'pageLimit'=>  $this->getPageLimit(),
                            )
                        )
                );
   }
   public function getDataApi()
   {
       $value = '';
       foreach($this->colNames as $v)
       {
           $value .= $v.',';
       }
        return $this->dataApi.'&value='.$value;
   }
   public function setDataApi($value)
   {
       $this->dataApi=$value;
   }
   //
   public function getColNames()
   {
       $codeRow = '';
       $code = 'colNames:[';
       foreach($this->colNames as $k => $v)
       {
           $codeRow .= "'$k',";
       }
       $code .= substr($codeRow, 0,-1);
       $code .= '],';
       return $code;
   }
 
    public function setColNames($value)
    {
        return $this->colNames=$value;
    }
    
    
    
    public function getPageLimit()
    {
        return $this->pageLimit;
    }
    public function setPageLimit($value)
    {
        return $this->pageLimit=$value;
    }
    
}  
?>
